package org.jadedanha.dao;

import java.sql.*;
import java.util.*;
import org.jadedanha.model.*;

public class JogadorDao extends Dao {

    public void save( Jogador j ) throws SQLException {

        String sql;

        sql = "INSERT INTO jogador (status, id_usuario, id_jogo) VALUES(?, ?, ?)";

        PreparedStatement stm = this.getConnection().prepareStatement(sql);

        stm.setInt(1, j.getStatus() );
        stm.setInt(2, j.usuario.getId() );
        stm.setInt(3, j.jogo.getId() );

        stm.execute();
        stm.close();
    }

    public static void main(String[] args) {
    }
}
